package servlet;

import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import model.AddMasterImpl;
import model.PollUserImpl;
import model.mappingImpl;
import bean.Poll;
import bean.PollUser;
public class mappingservlet extends HttpServlet {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6575508154655257827L;	
	
	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doPost (request, response);
	}
	
	public void doPost (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		
		response.setContentType("text/html");
		response.setCharacterEncoding("GBK");
		String lat = request.getParameter("Lat");
		String lng = request.getParameter("Lng");
		
		System.out.println("LATITUDE::"+lat);
		System.out.println("Longitude::"+lng);
		
		mappingImpl mapi = new mappingImpl();
		mapi.mapping(lat, lng, "1");
		
		
		String forward;
			
			forward = "mapping.jsp";
		
		RequestDispatcher rd=request.getRequestDispatcher(forward);
		rd.forward(request, response);
	}
}
